package com.springboot.astra.service.serviceImpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.springboot.astra.bean.Reply;
import com.springboot.astra.mapper.ReplyMapper;
import com.springboot.astra.service.ReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ReplyServiceImpl implements ReplyService {
    @Autowired
    ReplyMapper replyMapper;

    @Override
    public Reply getOneById(Integer id) {
        return replyMapper.getOneById(id);
    }

    @Override
    public IPage<Reply> getAll(Page<Reply> page, String query) {
        return replyMapper.getAll(page,query);
    }

    @Override
    public IPage<Reply> getAllIsReport(Page<Reply> page, String query) {
        return replyMapper.getAllIsReport(page,query);
    }

    @Override
    public IPage<Reply> getAllForUser(Page<Reply> page, Integer postMainId) {
        return replyMapper.getAllForUser(page,postMainId);
    }

    @Override
    public IPage<Reply> getAllReplyByUserId(Page<Reply> page, Integer userId) {
        return replyMapper.getAllReplyByUserId(page,userId);
    }

    @Override
    public void insertReply(Reply reply) {
        replyMapper.insertReply(reply);
    }

    @Override
    public void updateOneById(Reply reply) {
        replyMapper.updateOneById(reply);
    }

    @Override
    public void reportReply(Integer replyId) {
        replyMapper.reportReply(replyId);
    }


    @Override
    public void deleteOneById(Reply reply) {
        replyMapper.deleteOneById(reply);
    }
}
